<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <link rel="stylesheet" href="./index.css" />
  </head>
  <body>
    <div id="app">
      <header>
        <div class="container header">
          <div class="left">
            <div>您好，欢迎来到疯游精旅游网！</div>
            <div>
              <a href="#">登录</a>
              <span class="line">|</span>
              <a href="#">注册</a>
            </div>
          </div>
          <div class="right">
            <div>
              <a href="#">我的疯游</a>
            </div>
            <div class="line">|</div>
            <div>
              <a href="#">微信</a>
            </div>
            <div class="line">|</div>
            <div>
              <a href="#">客户服务</a>
            </div>
          </div>
        </div>
      </header>
      <nav>
        <div class="container nav">
          <div class="left">
            <img src="./images/index_03.png" alt="" />
          </div>
          <div class="right">
            <img src="./images/index_06.png" alt="" />
          </div>
        </div>
      </nav>
      <div class="title container">
        <div>注册用户</div>
      </div>
      <div class="container form">
        <div>
          <div class="form-item">
            <div class="label">
              <label for="username"
                ><span style="color: red; margin-right: 5px">*</span
                >用户名:</label
              >
            </div>
            <div class="input">
              <input
                type="text"
                id="username"
                name="username"
                v-model="form.username"
              />
            </div>
          </div>
          <div class="form-item">
            <div class="label">
              <label for="password">
                <span style="color: red; margin-right: 5px">*</span>密码:</label
              >
            </div>
            <div class="input">
              <input
                type="password"
                id="password"
                name="password"
                v-model="form.password"
              />
            </div>
          </div>
          <div class="form-item">
            <div class="label">
              <label for="repassword">
                <span style="color: red; margin-right: 5px">*</span>
                确认密码:</label
              >
            </div>
            <div class="input">
              <input
                type="password"
                id="repassword"
                name="repassword"
                v-model="form.repassword"
              />
            </div>
          </div>

          <div class="form-item">
            <div class="label">
              <label for="sex">性别:</label>
            </div>
            <div class="input">
              <span>男:</span>
              <input type="radio" name="sex" value="1" v-model="form.sex" />
              <span>女:</span>
              <input type="radio" name="sex" value="2" v-model="form.sex" />
            </div>
          </div>
          <div class="form-item">
            <div class="label">
              <label for="phone">手机号:</label>
            </div>
            <div class="input">
              <input type="number" name="phone" v-model="form.phone" />
            </div>
          </div>

          <div class="form-item">
            <div class="label">
              <label for="city">城市:</label>
            </div>
            <div class="input">
              <select
                name="city"
                v-model="form.province"
                @change="changeProvince"
              >
                <option disabled value="">省份</option>
                <template v-for="province in allCity" :key="province.name">
                  <option>{{province.name}}</option>
                </template>
              </select>
              <select v-model="form.city" @change="changeCity">
                <option disabled value="">市区</option>
                <option v-for="city in cities.city" :key="city.name">
                  {{city.name}}
                </option>
              </select>
              <select v-model="form.town" @change="changeTown">
                <option disabled value="">区县</option>
                <option v-for="item in towns.area" :key="item">{{item}}</option>
              </select>
            </div>
          </div>
          <div class="form-item">
            <div class="label">
              <label for="birth">出生日期:</label>
            </div>
            <div class="input">
              <input type="date" v-model="form.date" />
            </div>
          </div>
          <div class="form-item">
            <div class="label">
              <label for="idcard">身份证号:</label>
            </div>
            <div class="input">
              <input type="text" name="idcard" v-model="form.idcard" />
            </div>
          </div>
          <div class="form-item">
            <button @click="submit">注册</button>
          </div>
        </div>
      </div>
    </div>

    <script src="https://unpkg.com/vue@3"></script>
    <script src="./index.js"></script>
  </body>
</html>
